import request from '../request';
import request_app from '../request_app';
// 订单列表
export const dayOrderIndex = (params) => {
  return request('/statistics/home/ebmerIndex', params, 'post');
};
// 订单详情
export const dayOrderInfoByIds = (params) => {
  return request('/statistics/home/ebmerIndexInfoByIds', params, 'post');
};

//获取个人信息
export const getUserInfo = (params) => {
  return request('/system/mer/' + params, {}, 'get');
};
// 修改商户/供应商
export const updateMer = (params) => {
  return request('/system/mer/', params, 'put');
};

// 核销订单列表
export const reconciledList = (params) => {
  return request_app('localfife/reconciledList', params, 'get');
};
// 券码核销
export const orderVerification = (params) => {
  return request('/system/localLife/orderVerification', params, 'get');
};
//核销订单详情
export const orderInfoByticketCode = (params) => {
  return request('/system/localLife/orderInfoByticketCode', params, 'get');
};
//订单详情
export const orderInfo = (params) => {
  return request_app('localfife/orderInfo', params, 'get');
};
//退款开始
/**
 * 商户订单列表
 * @param object data
 */
export const orderlistBusiness = (params) => {
  return request_app('order/orderlist/business', params, 'get');
};
/**
 * 订单统计数据
 */
export const orderData = (params) => {
  return request_app('order/data', params, 'get');
};
/**
 * 确认退款
 * @param object data
 */
export const refundConfirm = (params) => {
  return request_app('order/refund/confirm', params, 'get');
};

//退款结束
//商户查看邀请记录

export const getMerInviteUserList = (params) => {
  return request('/system/merInviteUser/getMerInviteUserList', params, 'get');
};
/* 商家邀请返利列表 */
export const getMerInviteList = (params) => {
  return request('/system/merInviteUserIntegrainfo/list', params, 'get');
};
/* 商家邀请返利列表汇总 */
export const getMerListSum = (params) => {
  return request('/system/merInviteUserIntegrainfo/listSum', params, 'get');
};

export const merInviteUserIntegraExchange = (params) => {
  return request('/system/merInviteUserIntegraExchange', params, 'post');
}; /* 申请提现记录 */
export const getWithdrawList = (params) => {
  return request_app('system/merInviteUserIntegraExchange/list', params, 'get');
};
/* 提现功能 */
export const tixianYue = (data) => {
  return request_app('system/merInviteUserIntegraExchange', data, 'post');
};
// 查询订单列表
export const listOrder = (params) => {
  return request('/system/order/list',  params, 'get');
};

// 订单 立即退款
export const orderRefundApi = (params) => {
  return request('/store/order/refund',  params, 'get');
};
/*通过code换取openid */
export const merchantOpenid = (data) => {
  return request('/wechat/getMerchantOpenid',  data, 'post');
};
/*提现功能 */
export const transferToUser = (data) => {
  return request('/wechatToUser/transferToUser',  data, 'put');
};
/* 提现记录 */
export const transferToUserList= (params) => {
  return request("/wechatToUser/list", params, "get");
}
/* 累计提现 */
export const transferToUserSum = (params) => {
  return request("/wechatToUser/listSum", params, "get");
}
/* 线下配置 */
export const updateMer1 = (data) => {
  return request('/system/mer', data, "put");
}
/* 传递子商户号 */
export const setWxPayConfig = (params) => {
  return request('/system/mer/incomingParts/wechat/wxPayConfig/' +params, {}, "get");
}
